package vn.allmobile.newsreader.activities.main;

import java.util.List;

import vn.allmobile.newsreader.R;
import vn.allmobile.newsreader.adapters.AllPapersAdapter;
import vn.allmobile.newsreader.data.Paper;
import vn.allmobile.newsreader.utils.Utils;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ExpandableListView;

public class MainAllPapersActivity extends Activity {
	private ExpandableListView mExpandableListView;
	private List<Paper> mListPapers;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.allpapers);
		mExpandableListView = (ExpandableListView) findViewById(R.id.allpapers_expandableListView);
		this.mListPapers = Utils.getPapers(this.getApplicationContext());
		this.mListPapers.get(0).setEnable(true);
		AllPapersAdapter mAdapter = new AllPapersAdapter(
				getApplicationContext(), this.mListPapers);
		mExpandableListView.setAdapter(mAdapter);
		// Button save
		Button mSaveButton = (Button) findViewById(R.id.allpapers_savebutton);
		mSaveButton.setOnClickListener(saveSettings);
		// Button close
		Button mCloseButton = (Button) findViewById(R.id.allpapers_closebutton);
		mCloseButton.setOnClickListener(closeScreen);
	}

	private OnClickListener saveSettings = new OnClickListener() {

		@Override
		public void onClick(View v) {

		}
	};

	private OnClickListener closeScreen = new OnClickListener() {

		@Override
		public void onClick(View v) {
			finish();
		}
	};
}
